<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目绩效</title>
<link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.form.js"></script>
    <script type="text/javascript">

function search(){

    var key = $("#key").val();
    var url = "<c:url value="/clazz/process?m=list"/>";
    if(key!=""){
        url+="&key="+key;
    }else{
        alert("查询不能为空");
        return;
    }

    location=url;
}
function addproject(){

    var url = "<c:url value="/clazz/process?m=add"/>";;

    location=url;
}

function downexcel(){

    location='${downexcel}';
}
function changeselect(){
	var url='<c:url value="/clazz/process?m=list"/>';

	if($("#jidu").val()!=""){
		url+='&jidu='+$("#jidu").val();
	}
    if($("#ptid").val()!=""){
        url+='&ptid='+$("#ptid").val();
    }
    if($("#statuid").val()!=""){
        url+='&statuid='+$("#statuid").val();
    }
    <c:if test="${sessionScope.user.permission.code==1}">
        if($("#aesid").val()!=""){
            url+='&aesid='+$("#aesid").val();
        }
    </c:if>
	location=url;
}
</script>
</head>
<body>
<div class="content">
<jsp:include page="../pub/top.jsp"></jsp:include>
<!--头部结束-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="left" valign="top">
<jsp:include page="../pub/left_clazz.jsp"></jsp:include>
</td>
<td valign="top">
	<div id="c01">
	<dl>
        <dt style="padding-right:30px;">时间选择：
            <select id="jidu" name="jidu" style="width:100px;" onchange="changeselect()">
                <option value="0">全部</option>
                <c:forEach items="${jiduList}" var="jidu">
                    <option value="${jidu.jiduid}" ${jidu.jiduid == param.jidu?'selected=selected':''}><c:out value="${jidu.jiduvalue}"/></option>
                </c:forEach>
            </select>

        </dt>
    <c:if test="${sessionScope.user.permission.code==1}">
        <dt style="padding-right:30px;">隶属/下单人：
            <select id="aesid" name="aesid" style="width:100px;" onchange="changeselect()">
                <option value="0">全部</option>
                <c:forEach items="${aes}" var="ae">
                    <option value="${ae.id}" ${ae.id == param.aesid?'selected=selected':''}><c:out value="${ae.username}"/></option>
                </c:forEach>
            </select>

        </dt>
    </c:if>
        <dt style="padding-right:30px;">所属产品：
            <select id="ptid" name="ptid" style="width:100px;" onchange="changeselect()">
                <option value="0">全部</option>
                <c:forEach items="${produceList}" var="produce">
                    <option value="${produce.id}" ${produce.id==param.ptid?'selected=selected':''}><c:out value="${produce.producename}"/></option>
                </c:forEach>
            </select>

        </dt>
        <dt style="padding-right:30px;">进度：
            <select id="statuid" name="statuid" style="width:100px;" onchange="changeselect()">
                <option value="0">全部</option>
                <c:forEach items="${status}" var="statu">
                    <option value="${statu.code}" ${statu.code==param.statuid?'selected=selected':''}><c:out value="${statu.value}"/></option>
                </c:forEach>
            </select>

        </dt>
	<dt >关键字（项目名）:<input type="text" class="qidian" id="key" name="key" value="${key}"/> </dt>
	<dd style="padding-right:30px;"><input type="button" value="查询" class="chaxun" onclick="search()"/></dd>
     <%--<dd ><input type="button" value="新增项目" class="chaxun" onclick="addproject()"/></dd>--%>
        <dd style="margin-left:50px;padding-right:30px;"><input type="button" value="下载列表"  class="chaxun" onclick="downexcel()"/></dd>
    </dl>
	  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff">
	    <tr>
	      <td width="5%" height="30" bgcolor="#e5edfa" align="center">序号</td>
            <td width="8%" height="30" bgcolor="#e5edfa" align="center" >季度</td>
            <td width="10%" height="30" bgcolor="#e5edfa" align="center" >项目名</td>
            <td width="5%" height="30" bgcolor="#e5edfa" align="center">所属产品</td>
            <td width="5%" height="30" bgcolor="#e5edfa" align="center" >隶属</td>
            <td width="8%" height="30" bgcolor="#e5edfa" align="center" >下单人</td>
	        <td width="8%" height="30" bgcolor="#e5edfa" align="center">TC号</td>
            <td width="8%" height="30" bgcolor="#e5edfa" align="center">PO号</td>
	        <td width="5%" height="30" bgcolor="#e5edfa" align="center">PO金额</td>
            <td width="5%" height="30" bgcolor="#e5edfa" align="center">计划利润率</td>
            <td width="12%" height="30" bgcolor="#e5edfa" align="center">项目状态</td>
	      <td width="20%" height="30" bgcolor="#e5edfa" align="center">操作选项</td>
	    </tr>
		<c:choose>
		<c:when test="${not empty projectList}">
		<c:forEach items="${projectList}" var="project" varStatus="vs">
		<tr>
	      <td height="30" bgcolor="#FFFFFF" align="center">
	        <input type="checkbox" name="projectId" value="${project.id}"/>
	        <c:out value="${vs.index+1}"/></td>
            <td height="30" bgcolor="#FFFFFF" align="center">
                <c:out value="${project.pryear}"/>年 第<c:out value="${project.prjidu}"/>季度
            </td>
	      <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
              <c:out value="${project.name}"/>
              <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
          </td>
            <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                <a href="<c:url value="/clazz/produce?m=check&id=${project.produce.id}"/>"><c:out value="${project.produce.producename}"/></a>
                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
            </td>
            <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                    <c:out value="${project.co.username}"/>
            </td>
            <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                    <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                        <c:out value="${project.ae.username}"/>
            </td>
	        <td height="30" bgcolor="#FFFFFF" align="center">
                <%--<c:out value="${clazz.industry}"/>--%>
                    <c:out value="${project.tc}"/>
            </td>
	      <td height="30" bgcolor="#FFFFFF" align="center">
              <%--<c:out value="${clazz.price}"/>--%>
                  <c:out value="${project.po}"/>
          </td>
            <td height="30" bgcolor="#FFFFFF" align="center">
                    <%--<c:out value="${clazz.price}"/>--%>
                <c:out value="${project.ponum}"/>
            </td>
          <td height="30" bgcolor="#FFFFFF" align="center">
              <%--<c:out value="${clazz.openTime}"/>--%>
                  <c:out value="${project.planrate}"/>
          </td>
          <td height="30" bgcolor="#FFFFFF" align="center" style="color: #cc0000">
              <%--<a href="<c:out value="${clazz.img}"/>" > <c:out value="${clazz.img}"/></a>--%>
                  <c:out value="${project.statusTypeVO.value}"/>
          </td>
	      <td  height="30" bgcolor="#FFFFFF" align="center">
              <a href="<c:url value="/clazz/process?m=check&id=${project.id}"/>">查看</a>
	           <a href="<c:url value="/clazz/process?m=edit&id=${project.id}"/>">修改</a>
              <c:if test="${sessionScope.user.permission.code==1}">
	      	    <%--<a href="javascript:del(${project.id})">删除</a>--%>
                  <%--<a href="javascript:void(0)" onclick="show('${project.id}')">删除</a>--%>
              </c:if>
	      </td>
	    </tr>				
	    </c:forEach>
            <tr>
                <td height="30" bgcolor="#FFFFFF" align="center"/>
            <tr/>
            <tr>
                <td height="30" bgcolor="#FFFFFF" align="center"/>
            <tr/>
            <tr>
                <td height="30" bgcolor="#FFFFFF" align="center">

            </td>
                <td height="30" bgcolor="#FFFFFF" align="center">

                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">

                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">

                </td>


                <td height="30" bgcolor="#FFFFFF" align="center">
                    计划金额合计
                </td>
                <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">
                    <c:out value="${sum.kipnum}"/>
                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">

                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">
                    PO金额合计
                </td>
                <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">
                    <c:out value="${sum.doneponum}"/>
                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">

                </td>
                <td height="30" bgcolor="#FFFFFF" align="center">
                    已经开票金额
                </td>
                <td height="30" bgcolor="#FFFFFF" align="center" style="color: #0000cc">
                    <c:out value="${sum.billnum}"/>
                </td>
            </tr>
        </c:when>
		<c:otherwise>
		<tr>
			<td colspan="13" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
		</tr>	
		</c:otherwise>
		</c:choose>
	  </table>
        <jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>
	  <%--<p><input type="checkbox" onclick="selectAll(this)"/> 全选 --%>
	  <%--<input type="button" value="删除" class="shanchu" onclick="del(0)"/></p>--%>
	  <%--<jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>--%>
	</div>
	<br />
	<br />
</td>
</tr>
</table>
<jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
